# gen.py
import random
import string

def generate_data(length_range=(0, 100), k_range=(1, 10)):
    """
    生成一个随机小写字母字符串和一个随机整数k
    :param length_range: 字符串长度范围
    :param k_range: k的范围
    :return: (s, k)
    """
    length = random.randint(*length_range)
    s = ''.join(random.choices(string.ascii_lowercase, k=length))
    k = random.randint(*k_range)
    return s, k

